home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2001 January / Game.EXE_01_2001.iso / demos / Blade of Darkness / data1.cab / Program_Executable_Files / Lib / Ontake.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-11-16  |  1.6 KB  |  43 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. TakeDictionary = { }
  5.  
  6. def AddOnTakeEvent(objname, funct):
  7.     TakeDictionary[objname] = funct
  8.  
  9.  
  10. def DelOnTakeEvent(objname):
  11.     if TakeDictionary.has_key(objname):
  12.         del TakeDictionary[objname]
  13.     
  14.  
  15.  
  16. def OnTakeFunc(objname):
  17.     if TakeDictionary.has_key(objname):
  18.         TakeDictionary[objname]()
  19.     
  20.  
  21.  
  22. def SaveData(filename):
  23.     import cPickle
  24.     funcfile = open(filename, 'wt')
  25.     p = cPickle.Pickler(funcfile)
  26.     d = (TakeDictionary,)
  27.     p.dump(d)
  28.     funcfile.close()
  29.  
  30.  
  31. def LoadData(filename):
  32.     global TakeDictionary
  33.     import cPickle
  34.     funcfile = open(filename, 'rt')
  35.     p = cPickle.Unpickler(funcfile)
  36.     d = p.load()
  37.     funcfile.close()
  38.     print d
  39.     TakeDictionary = d[0]
  40.  
  41. import GameState
  42. GameState.ModulesToBeSaved.append(__import__(__name__))
  43.